<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width,height=device-height,initial-scale=1.0,user-scalable=no,minimum-scale=1.0,maximum-scale=1.0"/>
    <title>修改密码</title>
    <div th:include="head :: res"></div>
    <script>
        function btnSubmit() {
            if ($("#inputPassword3").val() === $("#inputPassword4").val()) {
                $("#submitBtn").click();
            } else {
                alert("两次输入密码不一样！");
            }

        }
    </script>
</head>
<body class="container">
<div th:include="head :: header-nav"></div>
<br>
<form class="form-horizontal" action="/modifypwd" method="post" id="contentForm">
    <div class="form-group">
        <label for="inputEmail4" class="col-sm-2 control-label">姓名：</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="inputEmail4" th:value="${user.getName()}" readonly="readonly">
        </div>
    </div>
    <div class="form-group">
        <label for="inputEmail3" class="col-sm-2 control-label">用户名：</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="inputEmail3" th:value="${user.getUsername()}"
                   readonly="readonly">
        </div>
    </div>
    <div class="form-group">
        <label for="inputPassword3" class="col-sm-2 control-label">新密码：</label>
        <div class="col-sm-10">
            <input type="password" class="form-control" id="inputPassword3" placeholder="请输入新密码" name="newPwd" required>
        </div>
    </div>
    <div class="form-group">
        <label for="inputPassword3" class="col-sm-2 control-label">新密码：</label>
        <div class="col-sm-10">
            <input type="password" class="form-control" id="inputPassword4" placeholder="请再次确认新密码" required>
        </div>
    </div>
    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
            <button type="button" class="btn btn-primary" onclick="btnSubmit()">保 存</button>
            <button type="submit" id="submitBtn" style="display: none"></button>
        </div>
    </div>
</form>
</body>
</html>